﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Microhard.Permission.Interface;
using Micrhard.FMCG.Server.Models;
using Micrhard.FMCG.Server.Interface;
using Microsoft.Practices.Unity;
using Microhard.Permission.MVCFilter;
using Micrhard.FMCG.Server.Impl;
using Microhard.Core.DBUtility;

namespace Microhard.FMCG.WebUI.Areas.Report.Controllers
{
    public class SaleVolumnController : MicroHardBaseController<SubKAModel>
    {
        public SaleVolumnController()
        {
            _isUsingPagingInIndex = false;
        }

        private ISubKA _resp = null;
        [Dependency]
        public ISubKA Employee
        {
            set
            {
                base._repository = value;
                _resp = value;
            }
            get
            {
                return _resp;
            }
        }

        [MVCFilterAtrForLogon(Order = 1)]//登录验证
        [MVCFilterAtrForResourcePermission(OperationKeyName = "Index", Order = 2)]//功能权限验证
        [MVCFilterAtrForCustomeDataPermission(typeof(UserGetSubKAValidator), DataScopeactionParameterName = "scope", Order = 3)]//数据权限验证
        public ActionResult GetProductSaledDetailOfDay(Guid identity, DateTime fromdate, DateTime enddate, string sys, ScopeResult scope)
        {
            _resp.scope = scope;
            var data = _resp.GetSubKASaledProductDetail(identity, fromdate, enddate, sys);
            return Json(data, JsonRequestBehavior.AllowGet);
        }

    }
}
